When an image is captured electronically, it tends to be affected by noise. In particular, most image sensors introduce photon shot noise and dark current noise into images that they capture. Noise can also be introduced by operations in the image formation processing chain (for example demosaicing).
Filtering is commonly used to remove noise from images. This invention concerns vectorial image neighbour filtering. A local neighbour filter calculates the output value of a subject pixel using statistics concerning neighbour pixels found in a window around the subject pixel. The subject pixel is typically at the centre of the window. As the subject pixel changes to allow filtering of the whole image, the window is moved and new neighbour pixels are identified. The window is therefore often referred to as a sliding window.
The pixels of the image may each be represented by a colour vector. The colour vector is made up of a value in each one of several different dimensions or channels. For an image coded using an RGB standard, the colour vector has three dimensions or channels; red, green and blue. The value in each channel can take one of a given number of levels. Coding images with 255 levels in each channel is common.
One particular local neighbour vector filter, referred to as a vector sigma filter, is described in the paper “Vector Sigma Filters For Noise Detection And Removal In Colour Images”, Lukac et al, J. Vis. Commun. Image R. 17 (2006) 1-26. The principle of this filter is to replace the colour vector of the subject pixel by the average of the colour vectors of only the neighbour pixels that respect a fixed criterion. More specifically, the new colour vector {right arrow over (g)}(i,j) of the subject pixel at coordinates i,j in the filtered image is defined by
                                          g            →                    ⁡                      (                          i              ,              j                        )                          =                                            ∑                              s                =                                  (                                      i                    -                    m                                    )                                                            m                +                i                                      ⁢                                          ∑                                  t                  =                                      (                                          j                      -                      m                                        )                                                                    m                  +                  j                                            ⁢                                                δ                                      s                    ,                    t                                                  ⁢                                                      f                    →                                    ⁡                                      (                                          s                      ,                      t                                        )                                                                                                          ∑                              s                =                                  (                                      i                    -                    m                                    )                                                            m                +                i                                      ⁢                                          ∑                                  t                  =                                      (                                          j                      -                      m                                        )                                                                    m                  +                  j                                            ⁢                              δ                                  s                  ,                  t                                                                                        (        1        )            
where {right arrow over (f)}(s,t) is the colour vector of a neighbour pixel at coordinates s,t, the sliding window has dimensions (2m+1)×(2m+1) and δs,t is a Dirac function defined by
                              δ                      s            ,            t                          =                  {                                                                                          1                    ⁢                                                                                  ⁢                    if                    ⁢                                                                                  ⁢                                                                                                                                              f                            →                                                    ⁡                                                      (                                                          s                              ,                              t                                                        )                                                                          -                                                                              f                            →                                                    ⁡                                                      (                                                          i                              ,                              j                                                        )                                                                                                                                                      ≤                                      (                                          k                      ×                      Δ                                        )                                                                                                                        0                  ⁢                                                                          ⁢                  otherwise                                                              ⁢                                                                    (        2        )            
where |{right arrow over (f)}(s,t)−{right arrow over (f)}(i,j)| is the difference between the colour vector {right arrow over (f)}(s,t) of a neighbour pixel and the colour vector {right arrow over (f)}(i,j) of the subject pixel, and (k×Δ) is a threshold value in which k is a variable and Δ is the standard deviation of the colour vectors of the neighbour pixels, which can be defined by
                    Δ        =                                            1                                                (                                                            2                      ⁢                      m                                        +                    1                                    )                                2                                      ⁢                                          ∑                                  i                  =                  1                                                                      (                                                                  2                        ⁢                        m                                            +                      1                                        )                                    2                                            ⁢                                                (                                                                                                                                                                f                            →                                                    i                                                -                                                  μ                          →                                                                                                            2                                    )                                2                                                                        (        3        )            
where fi is the colour vector of the ith neighbour pixel in the window and {right arrow over (μ)} is the mean colour vector of all the neighbour pixels in the window.
It can be appreciated from equation (2) that the new colour vector {right arrow over (g)}(i,j) yielded from equation (1) is based on only neighbour pixels in the window having a colour vector {right arrow over (f)}(s,t) that differs from the colour vector {right arrow over (f)}(i,j) of the subject pixel by an amount less than or equal to the threshold (k×Δ). So, neighbour pixels that have a colour vector {right arrow over (f)}(s,t) that differs too much from the colour vector {right arrow over (f)}(i,j) of the subject pixel are discarded and not used in the calculation of the new colour vector {right arrow over (g)}(i,j).
This filter reduces noise in images. However, it suffers from a known drawback that impulsive noise represented by clusters of one or two pixels is not always eliminated. To overcome this drawback, it has been suggested to calculate an improved new colour vector {right arrow over (ĝ)}(i,j) for the subject pixel as the average of the colour vectors {right arrow over (f)}(i,j) of just the pixels immediately adjacent to the subject pixel when the number n of neighbour pixels selected in equation (2) above is less than a given number N. This improved new colour vector {right arrow over (ĝ)}(i,j) can be defined by
                                                        g              →                        ^                    ⁡                      (                          i              ,              j                        )                          =                  {                                                                                          g                    →                                    ⁡                                      (                                          i                      ,                      j                                        )                                                                                                                    if                    ⁢                                                                                  ⁢                    n                                    >                  N                                                                                                      immediate                  ⁢                                                                          ⁢                                      neighbours                    '                                    ⁢                                                                          ⁢                  average                                                                                                  if                    ⁢                                                                                  ⁢                    n                                    ≤                  N                                                                                        (        4        )            
A common value of N is 5, as recommended in the paper “Digital Image Smoothing And The Sigma Filter”, Computer graphics and Image Processing, 24, 225-269, 1983. However, optimum image filtering is still not achieved using this modified version of the vector sigma filter. In particular, this filter still does not completely remove noise from an image. It also has a tendency to blur edges and thin details.
The present invention seeks to overcome these problems.